﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Register1
{
    public partial class frmMain : Form
    {
        public void SetInfo(string info)
        {
            this.textBox1.Text = info;
            this.textBox2.Text = info;
            //双调用
        }

        public frmMain()
        {
            InitializeComponent();
        }
        private void textBox1_TextChanged(object sender, EventArgs e)//用户名输入框
        {
            string name = textBox1.Text.Trim();//获取用户名
        }
        private void textBox2_TextChanged(object sender, EventArgs e)//用户密码的输入框
        {
            string pwd = textBox2.Text.Trim();//获取用户的密码
            
            
        }
        private void button2_Click(object sender, EventArgs e)//用户注册窗口
        {

        }
        private void button1_Click(object sender, EventArgs e)//登录窗口
        {

            if (textBox1.Text == "何嘉滨" && textBox2.Text == "123456")
            {
                DialogResult Register = MessageBox.Show("登录成功");
            }
            else
            {
                MessageBox.Show("账户密码错误");

            }
        }
        private void button3_Click(object sender, EventArgs e)//退出按钮
        {
            DialogResult DR= MessageBox.Show("你是否要退出？", "退出", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
            if(DR==DialogResult.Yes)
            {
                Application.Exit();
            }
        }

       
    }
}
